/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/
"use strict";

var $protobuf = require("protobufjs/light");

var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $protobuf.Root()))
.addJSON({
  Code: {
    values: {
      Reserved: 0,
      Success: 1,
      NoParameter: 2,
      InvalidParameter: 3,
      HasExisted: 4,
      DBError: 5,
      NoRecord: 6,
      ExecuteError: 7,
      TokenInvalid: 8,
      NoPermission: 9,
      GatewayOffline: 10
    }
  },
  Command: {
    values: {
      Default: 0,
      Heartbeat: 1000,
      StartALLVfd: 2001,
      StopALLVfd: 2002,
      StartAI: 2003,
      SetDefaultF: 2005,
      UpdateHz: 2006,
      SetRT: 2007,
      SetFRange: 2008
    }
  },
  CommandType: {
    values: {
      CTUnknown: 0,
      Req: 1,
      Resp: 2
    }
  },
  WSMessage: {
    fields: {
      id: {
        type: "string",
        id: 1
      },
      tid: {
        type: "string",
        id: 2
      },
      cmd: {
        type: "Command",
        id: 3
      },
      cmdType: {
        type: "CommandType",
        id: 4
      },
      tag: {
        type: "string",
        id: 5
      },
      data: {
        type: "google.protobuf.Any",
        id: 6
      }
    }
  },
  Response: {
    fields: {
      code: {
        type: "Code",
        id: 1
      },
      msg: {
        type: "string",
        id: 2
      },
      data: {
        type: "google.protobuf.Any",
        id: 3
      }
    }
  },
  DeviceStatus: {
    values: {
      DevStatusUnknown: 0,
      Start: 1,
      Stop: 2
    }
  },
  UploadType: {
    values: {
      UploadUnknown: 0,
      DevStatus: 1,
      Exception: 2,
      Order: 3,
      Statistics: 4
    }
  },
  DevType: {
    values: {
      DevUnknown: 0,
      DevEdge: 1,
      DevVfd: 2,
      DevCamera: 3,
      DevRelay: 4,
      DevSick: 5
    }
  },
  StatisticsType: {
    values: {
      StatisticsKnown: 0,
      Consumption: 1,
      PkgCount: 2
    }
  },
  ExceptionType: {
    values: {
      Unknown: 0,
      Connection: 1,
      Init: 2,
      Status: 3,
      Other: 4
    }
  },
  FrequencyRange: {
    fields: {
      fMax: {
        type: "int32",
        id: 1
      },
      fMin: {
        type: "int32",
        id: 2
      }
    }
  },
  MqttMessage: {
    fields: {
      edgeId: {
        type: "int64",
        id: 1
      },
      uploadType: {
        type: "UploadType",
        id: 2
      },
      data: {
        type: "google.protobuf.Any",
        id: 3
      }
    }
  },
  ReportStatistics: {
    fields: {
      statisticsType: {
        type: "StatisticsType",
        id: 1
      },
      data: {
        type: "google.protobuf.Any",
        id: 2
      }
    }
  },
  ReportPkgCount: {
    fields: {
      reportTs: {
        type: "string",
        id: 1
      },
      count: {
        type: "int64",
        id: 2
      }
    }
  },
  ReportConsumption: {
    fields: {
      reportTs: {
        type: "string",
        id: 2
      },
      q: {
        type: "float",
        id: 3
      }
    }
  },
  ReportException: {
    fields: {
      exceptionType: {
        type: "ExceptionType",
        id: 1
      },
      data: {
        type: "google.protobuf.Any",
        id: 2
      }
    }
  },
  ExceptionStatus: {
    fields: {
      ConnectionVFD: {
        type: "bool",
        id: 1
      },
      ConnectionRelay: {
        type: "bool",
        id: 2
      },
      ConnectionCamera: {
        type: "bool",
        id: 3
      },
      ConnectionWS: {
        type: "bool",
        id: 4
      },
      ConnectionMQTT: {
        type: "bool",
        id: 5
      },
      initRKNN: {
        type: "bool",
        id: 6
      }
    }
  },
  ReportCommand: {
    fields: {
      command: {
        type: "Command",
        id: 1
      },
      addr: {
        type: "int32",
        id: 2
      },
      conditionType: {
        type: "ConditionType",
        id: 3
      },
      data: {
        type: "google.protobuf.Any",
        id: 4
      }
    }
  },
  Public: {
    fields: {
      content: {
        type: "string",
        id: 1
      }
    }
  },
  ConditionType: {
    values: {
      ConditionUnknown: 0,
      TimeoutCatch: 1,
      CameraCatch: 2,
      RelayCatch: 3,
      AllCatch: 4,
      WSCatch: 5,
      ErrorCatch: 6
    }
  },
  ReportDevStatus: {
    fields: {
      devType: {
        type: "DevType",
        id: 1
      },
      data: {
        type: "google.protobuf.Any",
        id: 2
      }
    }
  },
  EdgeStatus: {
    fields: {
      cpu: {
        type: "float",
        id: 1
      },
      mem: {
        type: "float",
        id: 2
      },
      disk: {
        type: "float",
        id: 3
      },
      error: {
        type: "int32",
        id: 4
      }
    }
  },
  VfdStatus: {
    fields: {
      addr: {
        type: "int32",
        id: 1
      },
      status: {
        type: "DeviceStatus",
        id: 2
      },
      fCurrent: {
        type: "float",
        id: 3
      },
      fSet: {
        type: "float",
        id: 4
      },
      vCurrent: {
        type: "float",
        id: 5
      },
      aCurrent: {
        type: "float",
        id: 6
      },
      error: {
        type: "int32",
        id: 7
      }
    }
  },
  google: {
    nested: {
      protobuf: {
        nested: {
          Any: {
            fields: {
              type_url: {
                type: "string",
                id: 1
              },
              value: {
                type: "bytes",
                id: 2
              }
            }
          }
        }
      }
    }
  }
});

module.exports = $root;
